<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Hello MUI</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="css/mui.min.css">
		<link rel="stylesheet" type="text/css" href="css/icons-extra.css" />
	</head>

	<body>

		<style>
			.mui-control-content {
				background-color: white;
				min-height: 558px;
			}
			
			.mui-control-content .mui-loading {
				margin-top: 50px;
			}
		</style>
		<header class="mui-bar mui-bar-nav" style="background-color: white;">
			<!--<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>-->
			<!--<h1 class="mui-title">Korea Comics</h1>-->
			<div class="mui-input-row mui-search mui-plus-visible">
				<input id="search" type="search" class="mui-input-speech mui-input-clear" placeholder="Korea Comics" style="background-color: white;">
			</div>
		</header>
		<div class="mui-content">
			<div id="slider" class="mui-slider">
				<div id="sliderSegmentedControl" class="mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
					<a class="mui-control-item" href="#item1mobile">
						周一
					</a>
					<a class="mui-control-item" href="#item2mobile">
						周二
					</a>
					<a class="mui-control-item" href="#item3mobile">
						周三
					</a>
					<a class="mui-control-item" href="#item4mobile">
						周四
					</a>
					<a class="mui-control-item" href="#item5mobile">
						周五
					</a>
					<a class="mui-control-item" href="#item6mobile">
						周六
					</a>
				</div>
				<div id="sliderProgressBar" class="mui-slider-progress-bar mui-col-xs-2"></div>
				<div class="mui-slider-group">
					<div id="item1mobile" class="mui-slider-item mui-control-content mui-active">
						<div id="scroll1" class="mui-scroll-wrapper">
							<div class="mui-scroll">
								<ul id="one" class="mui-table-view">

								</ul>
							</div>
							
						</div>
					</div>
					<div id="item2mobile" class="mui-slider-item mui-control-content">
						<div id="scroll2" class="mui-scroll-wrapper">
							<div class="mui-scroll">
								<!--<div class="mui-loading">
									<div class="mui-spinner">
										
									</div>
									
								</div>-->
								<ul id="two" class="mui-table-view">

										</ul>
							</div>
						</div>

					</div>
					<div id="item3mobile" class="mui-slider-item mui-control-content">
						<div id="scroll3" class="mui-scroll-wrapper">
							<div class="mui-scroll">
								
								<ul id="three" class="mui-table-view">

										</ul>
							</div>
							
						</div>

					</div>
					<div id="item4mobile" class="mui-slider-item mui-control-content">
						<div id="scroll4" class="mui-scroll-wrapper">
							<div class="mui-scroll">
								
									<ul id="four" class="mui-table-view">

										</ul>
								
							</div>
						</div>

					</div>
					<div id="item5mobile" class="mui-slider-item mui-control-content">
						<div id="scroll5" class="mui-scroll-wrapper">
							<div class="mui-scroll">
								
									<ul id="five" class="mui-table-view">

										</ul>
								
							</div>
						</div>

					</div>
					<div id="item6mobile" class="mui-slider-item mui-control-content">
						<div id="scroll6" class="mui-scroll-wrapper">
							<div class="mui-scroll">
								
									<ul id=six class="mui-table-view">

										</ul>
								
							</div>
						</div>

					</div>
				</div>
			</div>

			<nav class="mui-bar mui-bar-tab">
				<a id="defaultTab" class="mui-tab-item mui-active update" href="tab-webview-subpage-about.html">
					<span class="mui-icon mui-icon-home"></span>
					<span class="mui-tab-label ">更新</span>
				</a>
				<a class="mui-tab-item discover" href="tab-webview-subpage-chat.html">
					<span class="mui-icon mui-icon-personadd"></span>
					<span class="mui-tab-label ">发现</span>
				</a>
				<a class="mui-tab-item mycomics" href="tab-webview-subpage-contact.html">
					<span class="mui-icon mui-icon-star-filled"></span>
					<span class="mui-tab-label ">我的漫画</span>
				</a>
				<a class="mui-tab-item my" href="tab-webview-subpage-setting.html">
					<span class="mui-icon mui-icon-contact"></span>
					<span class="mui-tab-label ">MY</span>
				</a>
			</nav>

			<script src="js/url.js"></script>
			<script src="js/jquery.min.js"></script>
			<script>
				/*
															 如果你要用jQuery必须将下面这行代码放在第一行，然后将$符号换成jQuery
															 * */

				$.noConflict();

				jQuery.ajax({
					url: serverip.ip + '/updateEveryday',
					dataType: 'json',
					data: {
						'time': 1
					},
					xhrFields: {
						withCredentials: true
					},
					success: function(data) {
						
						var ul = document.getElementById("one");
						ul.innerHTML=null;
						for(var i = 0; i < data.length; i++) {
							var li = document.createElement('li');
							li.classList.add('mui-table-view-cell');
							li.style.padding = 0;
							li.innerHTML = '<div class="mui-card one" style="margin:0">' +
												'<div class="mui-card-footer">' +
												'<a class="mui-card-link">[分类]' + data[i].comicsname + data[i].chapterPO.chapterName + '</a>' +
												'<a class="mui-card-link completeWorks"><div class="comicsid" style="display:none;">' + data[i].id + '</div>全集 <span class="mui-icon mui-icon-forward"></span></a>' +
												'</div>'+
											'<a ><div class="mui-card-header mui-card-media comicsPicture" style="height:40vw;background-image:url(' + serverip.ip2 + data[i].id + '/' + data[i].icon + ')">'+
											'<div class="chapterid" style="display:none;">' + data[i].chapterPO.id + '</div>'+
											'<div class="comicsid" style="display:none;">' + data[i].id + '</div>'+
											'<div class="chapterName" style="display:none;">' + data[i].chapterPO.chapterName + '</div>'+
											'<div class="comicsName" style="display:none;">' + data[i].comicsname + '</div>'+
											'</div></a>' +
												'<div class="mui-card-content">' +
												'<div class="mui-card-content-inner">' +
												'<span>作者:KroeaComics</span>' +
												'<span class="greatAndAttention" style="float :right">点赞 ' + data[i].easyLike + '</span>' +
												'</div>' +
												'</div>' +
												'</div>';
							ul.appendChild(li);
						}
						jQuery('.comicsPicture').bind('tap', function() {
											var chapterid = jQuery(this).find('.chapterid:first').text();
											var comicsid = jQuery(this).find('.comicsid:first').text();
											var chapterName = jQuery(this).find('.chapterName:first').text();
											var comicsName = jQuery(this).find('.comicName:first').text();
											mui.openWindow({
												url: 'watchComics.html',
												extras: {
													'chapterid': chapterid,
													'comicsid':comicsid,
													'chapterName':chapterName,
													'comicsName':comicsName
												}
											})
										});
						jQuery('.completeWorks').bind('tap', function() {
							var cid = jQuery(this).find('.comicsid:first').text();
							mui.openWindow({
								url: 'commandComics.html',
								extras: {
									comicsid: cid
								}
							})
						});

					}
				});
			</script>

			<script>
				document.getElementsByClassName("update")[0].addEventListener("tap", function() {
					mui.openWindow({
						url: "homePage.html"
					})
				});

				document.getElementsByClassName("discover")[0].addEventListener("tap", function() {
					mui.openWindow({
						url: "discover.html"
					})
				});

				document.getElementsByClassName("mycomics")[0].addEventListener("tap", function() {
					mui.openWindow({
						url: "myComics.html"
					})
				});

				document.getElementsByClassName("my")[0].addEventListener("tap", function() {
					mui.openWindow({
						url: "personalCenter.html"
					})
				});
			</script>

		</div>
		<script src="js/mui.min.js"></script>
		<script>
			mui.init({
				swipeBack: false
			});
			(function($) {
				$('.mui-scroll-wrapper').scroll({
					indicators: true //是否显示滚动条
				});

				var item2 = document.getElementById('item2mobile');
				var item3 = document.getElementById('item3mobile');

				var item4 = document.getElementById('item4mobile');
				var item5 = document.getElementById('item5mobile');

				var item6 = document.getElementById('item6mobile');
				document.getElementById('slider').addEventListener('slide', function(e) {
					if(e.detail.slideNumber === 1) {
						if(item2.querySelector('.mui-scroll')) {
							setTimeout(function() {
								jQuery.ajax({
									url: serverip.ip + '/updateEveryday',
									dataType: 'json',
									data: {
										'time': 2
									},
									xhrFields: {
										withCredentials: true
									},
									success: function(data) {
										
										var ul = document.getElementById("two");
                                          ul.innerHTML=null;
										for(var i = 0; i < data.length; i++) {
											
											var li = document.createElement('li');
											li.classList.add('mui-table-view-cell');
											li.style.padding = 0;
											li.innerHTML = '<div class="mui-card one" style="margin:0">' +
												'<div class="mui-card-footer">' +
												'<a class="mui-card-link">[分类]' + data[i].comicsname + data[i].chapterPO.chapterName + '</a>' +
												'<a class="mui-card-link completeWorks">'+
												'<div class="comicsid" style="display:none;">' + data[i].id + '</div>'+
												'全集 <span class="mui-icon mui-icon-forward"></span></a>' +
												'</div>'+
											'<a ><div class="mui-card-header mui-card-media comicsPicture" style="height:40vw;background-image:url(' + serverip.ip2 + data[i].id + '/' + data[i].icon + ')">'+
											'<div class="chapterid" style="display:none;">' + data[i].chapterPO.id + '</div>'+
											'<div class="comicsid" style="display:none;">' + data[i].id + '</div>'+
											'<div class="chapterName" style="display:none;">' + data[i].chapterPO.chapterName + '</div>'+
											'</div></a>' +
												'<div class="mui-card-content">' +
												'<div class="mui-card-content-inner">' +
												'<span>作者:KroeaComics</span>' +
												'<span class="greatAndAttention" style="float :right">点赞 ' + data[i].easyLike + '</span>' +
												'</div>' +
												'</div>' +
												'</div>';
											ul.appendChild(li);
										}
										jQuery('.comicsPicture').bind('tap', function() {
											var chapterid = jQuery(this).find('.chapterid:first').text();
											var comicsid = jQuery(this).find('.comicsid:first').text();
											var chapterName = jQuery(this).find('.chapterName:first').text();
											mui.openWindow({
												url: 'watchComics.html',
												extras: {
													'chapterid': chapterid,
													'comicsid':comicsid,
													'chapterName':chapterName
												}
											})
										});
										jQuery('.completeWorks').bind('tap', function() {
											var cid = jQuery(this).find('.comicsid:first').text();
											mui.openWindow({
												url: 'commandComics.html',
												extras: {
													comicsid: cid
												}
											})
										});

									}
								});

							}, 500);
						}
					} else if(e.detail.slideNumber === 2) {
						if(item3.querySelector('.mui-scroll')) {
							setTimeout(function() {
								jQuery.ajax({
									url: serverip.ip + '/updateEveryday',
									dataType: 'json',
									data: {
										'time': 3
									},
									xhrFields: {
										withCredentials: true
									},
									success: function(data) {
										var ul = document.getElementById("three");
                                          ul.innerHTML=null;
										for(var i = 0; i < data.length; i++) {
											var li = document.createElement('li');
											li.classList.add('mui-table-view-cell');
											li.style.padding = 0;
											li.innerHTML = '<div class="mui-card one" style="margin:0">' +
												'<div class="mui-card-footer">' +
												'<a class="mui-card-link">[分类]' + data[i].comicsname + data[i].chapterPO.chapterName + '</a>' +
												'<a class="mui-card-link completeWorks"><div class="comicsid" style="display:none;">' + data[i].id + '</div>全集 <span class="mui-icon mui-icon-forward"></span></a>' +
												'</div>'+
											'<a ><div class="mui-card-header mui-card-media comicsPicture" style="height:40vw;background-image:url(' + serverip.ip2 + data[i].id + '/' + data[i].icon + ')">'+
											'<div class="chapterid" style="display:none;">' + data[i].chapterPO.id + '</div>'+
											'<div class="comicsid" style="display:none;">' + data[i].id + '</div>'+
											'<div class="chapterName" style="display:none;">' + data[i].chapterPO.chapterName + '</div>'+
											'</div></a>' +
												'<div class="mui-card-content">' +
												'<div class="mui-card-content-inner">' +
												'<span>作者:KroeaComics</span>' +
												'<span class="greatAndAttention" style="float :right">点赞 ' + data[i].easyLike + '</span>' +
												'</div>' +
												'</div>' +
												'</div>';
											ul.appendChild(li);
										}
										jQuery('.comicsPicture').bind('tap', function() {
											var chapterid = jQuery(this).find('.chapterid:first').text();
											var comicsid = jQuery(this).find('.comicsid:first').text();
											var chapterName = jQuery(this).find('.chapterName:first').text();
											mui.openWindow({
												url: 'watchComics.html',
												extras: {
													'chapterid': chapterid,
													'comicsid':comicsid,
													'chapterName':chapterName
												}
											})
										});
										jQuery('.completeWorks').bind('tap', function() {
											var cid = jQuery(this).find('.comicsid:first').text();
											mui.openWindow({
												url: 'commandComics.html',
												extras: {
													comicsid: cid
												}
											})
										});

									}
								});
							}, 500);
						}
					} else if(e.detail.slideNumber === 3) {
						if(item4.querySelector('.mui-scroll')) {
							setTimeout(function() {
								jQuery.ajax({
									url: serverip.ip + '/updateEveryday',
									dataType: 'json',
									data: {
										'time': 4
									},
									xhrFields: {
										withCredentials: true
									},
									success: function(data) {
										var ul = document.getElementById("four");
                                         ul.innerHTML=null;
										for(var i = 0; i < data.length; i++) {
											var li = document.createElement('li');
											li.classList.add('mui-table-view-cell');
											li.style.padding = 0;
											li.innerHTML = '<div class="mui-card one" style="margin:0">' +
												'<div class="mui-card-footer">' +
												'<a class="mui-card-link">[分类]' + data[i].comicsname + data[i].chapterPO.chapterName + '</a>' +
												'<a class="mui-card-link completeWorks"><div class="comicsid" style="display:none;">' + data[i].id + '</div>全集 <span class="mui-icon mui-icon-forward"></span></a>' +
												'</div>'+
											'<a ><div class="mui-card-header mui-card-media comicsPicture" style="height:40vw;background-image:url(' + serverip.ip2 + data[i].id + '/' + data[i].icon + ')">'+
											'<div class="chapterid" style="display:none;">' + data[i].chapterPO.id + '</div>'+
											'<div class="comicsid" style="display:none;">' + data[i].id + '</div>'+
											'<div class="chapterName" style="display:none;">' + data[i].chapterPO.chapterName + '</div>'+
											'</div></a>' +
												'<div class="mui-card-content">' +
												'<div class="mui-card-content-inner">' +
												'<span>作者:KroeaComics</span>' +
												'<span class="greatAndAttention" style="float :right">点赞 ' + data[i].easyLike + '</span>' +
												'</div>' +
												'</div>' +
												'</div>';
											ul.appendChild(li);
										}
										jQuery('.comicsPicture').bind('tap', function() {
											var chapterid = jQuery(this).find('.chapterid:first').text();
											var comicsid = jQuery(this).find('.comicsid:first').text();
											var chapterName = jQuery(this).find('.chapterName:first').text();
											mui.openWindow({
												url: 'watchComics.html',
												extras: {
													'chapterid': chapterid,
													'comicsid':comicsid,
													'chapterName':chapterName
												}
											})
										});
										jQuery('.completeWorks').bind('tap', function() {
											var cid = jQuery(this).find('.comicsid:first').text();
											mui.openWindow({
												url: 'commandComics.html',
												extras: {
													comicsid: cid
												}
											})
										});

									}
								});
							}, 500);
						}
					} else if(e.detail.slideNumber === 4) {
						if(item5.querySelector('.mui-scroll')) {
							setTimeout(function() {
								jQuery.ajax({
									url: serverip.ip + '/updateEveryday',
									dataType: 'json',
									data: {
										'time': 5
									},
									xhrFields: {
										withCredentials: true
									},
									success: function(data) {
										var ul = document.getElementById("five");
                                         ul.innerHTML=null;
										for(var i = 0; i < data.length; i++) {
											var li = document.createElement('li');
											li.classList.add('mui-table-view-cell');
											li.style.padding = 0;
											li.innerHTML = '<div class="mui-card one" style="margin:0">' +
												'<div class="mui-card-footer">' +
												'<a class="mui-card-link">[分类]' + data[i].comicsname + data[i].chapterPO.chapterName + '</a>' +
												'<a class="mui-card-link completeWorks"><div class="comicsid" style="display:none;">' + data[i].id + '</div>全集 <span class="mui-icon mui-icon-forward"></span></a>' +
												'</div>'+
											'<a ><div class="mui-card-header mui-card-media comicsPicture" style="height:40vw;background-image:url(' + serverip.ip2 + data[i].id + '/' + data[i].icon + ')">'+
											'<div class="chapterid" style="display:none;">' + data[i].chapterPO.id + '</div>'+
											'<div class="comicsid" style="display:none;">' + data[i].id + '</div>'+
											'<div class="chapterName" style="display:none;">' + data[i].chapterPO.chapterName + '</div>'+
											'</div></a>' +
												'<div class="mui-card-content">' +
												'<div class="mui-card-content-inner">' +
												'<span>作者:KroeaComics</span>' +
												'<span class="greatAndAttention" style="float :right">点赞 ' + data[i].easyLike + '</span>' +
												'</div>' +
												'</div>' +
												'</div>';
											ul.appendChild(li);
										}
										jQuery('.comicsPicture').bind('tap', function() {
											var chapterid = jQuery(this).find('.chapterid:first').text();
											var comicsid = jQuery(this).find('.comicsid:first').text();
											var chapterName = jQuery(this).find('.chapterName:first').text();
											mui.openWindow({
												url: 'watchComics.html',
												extras: {
													'chapterid': chapterid,
													'comicsid':comicsid,
													'chapterName':chapterName
												}
											})
										});
										jQuery('.completeWorks').bind('tap', function() {
											var cid = jQuery(this).find('.comicsid:first').text();
											mui.openWindow({
												url: 'commandComics.html',
												extras: {
													comicsid: cid
												}
											})
										});

									}
								});
							}, 500);
						}
					} else if(e.detail.slideNumber === 5) {
						if(item6.querySelector('.mui-scroll')) {
							setTimeout(function() {
								jQuery.ajax({
									url: serverip.ip + '/updateEveryday',
									dataType: 'json',
									data: {
										'time': 6
									},
									xhrFields: {
										withCredentials: true
									},
									success: function(data) {
										var ul = document.getElementById("six");
                                         ul.innerHTML=null;
										for(var i = 0; i < data.length; i++) {
											var li = document.createElement('li');
											li.classList.add('mui-table-view-cell');
											li.style.padding = 0;
											li.innerHTML = '<div class="mui-card one" style="margin:0">' +
												'<div class="mui-card-footer">' +
												'<a class="mui-card-link">[分类]' + data[i].comicsname + data[i].chapterPO.chapterName + '</a>' +
												'<a class="mui-card-link completeWorks"><div class="comicsid" style="display:none;">' + data[i].id + '</div>全集 <span class="mui-icon mui-icon-forward"></span></a>' +
												'</div>'+
											'<a ><div class="mui-card-header mui-card-media comicsPicture" style="height:40vw;background-image:url(' + serverip.ip2 + data[i].id + '/' + data[i].icon + ')">'+
											'<div class="chapterid" style="display:none;">' + data[i].chapterPO.id + '</div>'+
											'<div class="comicsid" style="display:none;">' + data[i].id + '</div>'+
											'<div class="chapterName" style="display:none;">' + data[i].chapterPO.chapterName + '</div>'+
											'</div></a>' +
												'<div class="mui-card-content">' +
												'<div class="mui-card-content-inner">' +
												'<span>作者:KroeaComics</span>' +
												'<span class="greatAndAttention" style="float :right">点赞 ' + data[i].easyLike + '</span>' +
												'</div>' +
												'</div>' +
												'</div>';
											ul.appendChild(li);
										}
										jQuery('.comicsPicture').bind('tap', function() {
											var chapterid = jQuery(this).find('.chapterid:first').text();
											var comicsid = jQuery(this).find('.comicsid:first').text();
											var chapterName = jQuery(this).find('.chapterName:first').text();
											mui.openWindow({
												url: 'watchComics.html',
												extras: {
													'chapterid': chapterid,
													'comicsid':comicsid,
													'chapterName':chapterName
												}
											})
										});
										jQuery('.completeWorks').bind('tap', function() {
											var cid = jQuery(this).find('.comicsid:first').text();
											mui.openWindow({
												url: 'commandComics.html',
												extras: {
													comicsid: cid
												}
											})
										});

									}
								});

							}, 500);
						}
					}
				});
				var sliderSegmentedControl = document.getElementById('sliderSegmentedControl');
				$('.mui-input-group').on('change', 'input', function() {
					if(this.checked) {
						sliderSegmentedControl.className = 'mui-slider-indicator mui-segmented-control mui-segmented-control-inverted mui-segmented-control-' + this.value;
						//force repaint
						sliderProgressBar.setAttribute('style', sliderProgressBar.getAttribute('style'));
					}
				});
			})(mui);
		</script>

	</body>

</html>